package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.domain.entity.Vendor;
import com.ruoyi.system.mapper.VendorMapper;
import com.ruoyi.system.service.VendorService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author: ruohao
 * @Date: 2023/9/17
 **/
@Service
public class VendorServiceImpl implements VendorService {
    @Resource
    private VendorMapper vendorMapper;

    @Override
    public List<Vendor> selectList(Vendor vendor) {
        return vendorMapper.selectList(vendor);
    }

    @Override
    public List<Vendor> selectByIds(List<Long> ids) {
        return vendorMapper.selectByIds(ids);
    }

    @Override
    public Vendor selectById(Long id) {
        return vendorMapper.selectById(id);
    }

    @Override
    public Boolean create(Vendor vendor) {
        return vendorMapper.insert(vendor) == 1;
    }

    @Override
    public Boolean update(Vendor vendor) {
        return vendorMapper.update(vendor) == 1;
    }

    @Override
    public Boolean deleteById(Long id) {
        return vendorMapper.deleteById(id) == 1;
    }
}
